package com.tencent.cloud.iov.util.rx.proxy;

import io.reactivex.Observer;
import io.reactivex.functions.Consumer;

/**
 * {@link Observer#onError(Throwable)} 代理类
 *
 * @author showxiao
 * @date 2018/3/30
 */

public class ErrorConsumerProxy<T> implements Consumer<Throwable> {

    private final Observer<T> mObserver;

    public ErrorConsumerProxy(Observer<T> observer) {
        mObserver = observer;
    }

    @Override
    public void accept(Throwable throwable) throws Exception {
        mObserver.onError(throwable);
    }
}
